home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / syntax / simula.vim < prev    next >
Encoding:
Text File  |  1998-04-01  |  2.8 KB  |  77 lines

  1. " Vim syntax file
  2. " Language:    Simula
  3. " Maintainer:    Haakon Riiser <hakonrk@fys.uio.no>
  4. " Last change:    1998 Mar 26
  5.  
  6. " Clear old syntax defs
  7. syn clear
  8.  
  9. " No case sensitivity in Simula
  10. syn case    ignore
  11.  
  12. syn match    simulaComment        "^%.*$" contains=simulaTodo
  13. syn region    simulaComment        start="!\|comment" end=";" contains=simulaTodo
  14.  
  15. " Text between the keyword 'end' and either a semicolon or one of the
  16. " keywords 'end', 'else', 'when' or 'otherwise' is also a comment
  17. syn region    simulaComment        start="\<end\>"lc=3 matchgroup=simulaKeyword end=";\|\<\(end\|else\|when\|otherwise\)\>"
  18.  
  19. syn match    simulaCharacter        "'.\{-}'" contains=simulaSpecialChar
  20. syn match    simulaString        '".\{-}"' contains=simulaSpecialChar,simulaTodo
  21.  
  22. " Integer number (or float without `.')
  23. syn match    simulaNumber        "\<[0-9]\+\>"
  24. " Real with optional exponent
  25. syn match    simulaReal        "\<[0-9]\+\(\.[0-9]\+\)\=\(&&\=[+-]\=[0-9]\+\)\=\>"
  26. " Real starting with a `.', optional exponent
  27. syn match    simulaReal        "\.[0-9]\+\(&&\=[+-]\=[0-9]\+\)\=\>"
  28.  
  29. syn keyword    simulaBoolean        true false
  30. syn keyword    simulaConditional    else if otherwise then until when
  31. syn keyword    simulaConstant        none notext
  32. syn keyword    simulaFunction        procedure
  33. syn keyword    simulaKeyword        do begin end step this qua inner
  34. syn keyword    simulaOperator        eq eqv ge gt imp in is le lt ne not
  35. syn keyword    simulaRepeat        while for
  36. syn keyword    simulaStatement        inspect new
  37. syn keyword    simulaStorageClass    external hidden name protected
  38. syn keyword    simulaStructure        class
  39. syn keyword    simulaType        array boolean character integer long real short text value virtual
  40. syn match    simulaAssigned        "\<[a-z_][a-z0-9_]*\s*\((.*)\)\=\s*:\(=\|-\)"me=e-2
  41. syn match    simulaOperator        "\<and\(\s\+then\)\=\>"
  42. syn match    simulaOperator        "\<or\(\s\+else\)\=\>"
  43. syn match    simulaReferenceType    "\<ref\s*(.\{-})"
  44. syn match    simulaSemicolon        ";"
  45. syn match    simulaSpecial        "[(),.&:=<>+\-*/]"
  46. syn match    simulaSpecialChar    "![0-9]\+!" contained
  47. syn match    simulaTodo        "XXX\+" contained
  48.  
  49. if !exists("did_simula_syntax_inits")
  50.     let did_simula_syntax_inits = 1
  51.     hi link simulaAssigned        Identifier
  52.     hi link simulaBoolean        Boolean
  53.     hi link simulaCharacter        Character
  54.     hi link simulaComment        Comment
  55.     hi link simulaConditional    Conditional
  56.     hi link simulaConstant        Constant
  57.     hi link simulaFunction        Function
  58.     hi link simulaKeyword        Keyword
  59.     hi link simulaNumber        Number
  60.     hi link simulaOperator        Special
  61.     hi link simulaReal        Float
  62.     hi link simulaReferenceType    Type
  63.     hi link simulaRepeat        Repeat
  64.     hi link simulaSemicolon        Statement
  65.     hi link simulaSpecial        Special
  66.     hi link simulaSpecialChar    SpecialChar
  67.     hi link simulaStatement        Statement
  68.     hi link simulaStorageClass    StorageClass
  69.     hi link simulaString        String
  70.     hi link simulaStructure        Structure
  71.     hi link simulaTodo        Todo
  72.     hi link simulaType        Type
  73. endif
  74.  
  75. let b:current_syntax = "simula"
  76. " vim: ts=8 nowrap
  77.